home *** CD-ROM | disk | FTP | other *** search
- Subject: v25i015: trn 2.0 - threaded newsreader based on rn 4.4, Part12/13
- Newsgroups: comp.sources.unix
- Approved: vixie@pa.dec.com
-
- Submitted-by: davison@borland.com (Wayne Davison)
- Posting-number: Volume 25, Issue 15
- Archive-name: trn/part12
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 12 (of 13)."
- # Contents: Configure
- # Wrapped by vixie@cognition.pa.dec.com on Tue Dec 3 16:34:57 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'Configure' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Configure'\"
- else
- echo shar: Extracting \"'Configure'\" \(69963 characters\)
- sed "s/^X//" >'Configure' <<'END_OF_FILE'
- X#!/bin/sh
- X#
- X# This software is Copyright 1991 by Stan Barber.
- X#
- X# Permission is hereby granted to copy, reproduce, redistribute or otherwise
- X# use this software as long as: there is no monetary profit gained
- X# specifically from the use or reproduction of this software, it is not
- X# sold, rented, traded or otherwise marketed, and this copyright notice is
- X# included prominently in any copy made.
- X#
- X# The author make no claims as to the fitness or correctness of this software
- X# for any use whatsoever, and it is provided as is. Any use of this software
- X# is at the user's own risk.
- X#
- X# If these # comments don't work, trim them. Don't worry about the other
- X# shell scripts, Configure will trim # comments from them for you.
- X#
- X# $Id: Configure,v 4.4.3.1 1991/11/22 04:11:10 davison Trn $
- X#
- X# $Log: Configure,v $
- X# Revision 4.4.3.1 1991/11/22 04:11:10 davison
- X# Trn Release 2.0
- X#
- X# Revision 4.4.2.1 1991/12/01 18:05:42 sob
- X# Patchlevel 2 changes
- X#
- X# Revision 4.4.1.1 1991/09/25 19:38:08 sob
- X# various fixed
- X#
- X# Revision 4.4 1991/09/09 20:18:23 sob
- X# release 4.4
- X#
- X#
- X
- X# Yes, you may rip this off to use in other distribution packages.
- X
- CTRLA=`echo a | tr a '\001'`
- X
- bopt=''
- n=''
- c=''
- libc=''
- sharedclib=''
- eunicefix=''
- eunice=''
- cpp=''
- shsharp=''
- spitshell=''
- startsh=''
- test=''
- expr=''
- sed=''
- echo=''
- cat=''
- rm=''
- mv=''
- cp=''
- tail=''
- tr=''
- mkdir=''
- sort=''
- uniq=''
- inews=''
- grep=''
- egrep=''
- nidump=''
- ypmatch=''
- contains=''
- lib=''
- nametype=''
- cc=''
- cflags=''
- iandd=''
- rrninclude=''
- termlib=''
- jobslib=''
- ndirlib=''
- socketlib=''
- dirtype=''
- dirinc=''
- libndir=''
- usendir=''
- ndirc=''
- ndiro=''
- posix=''
- pager=''
- mailer=''
- internet=''
- rnbin=''
- filexp=''
- distlist=''
- Log=''
- Id=''
- sitename=''
- hostfile=''
- domain=''
- orgname=''
- isadmin=''
- newsadmin=''
- rnlib=''
- mtlib=''
- mansrc=''
- manext=''
- maildir=''
- spool=''
- serverspool=''
- active=''
- myactive=''
- activetimes=''
- mininact=''
- pref=''
- defeditor=''
- rootid=''
- mboxchar=''
- locpref=''
- orgpref=''
- citypref=''
- statepref=''
- cntrypref=''
- contpref=''
- strchr=''
- memcpy=''
- rename=''
- ftruncate=''
- usleep=''
- uselect=''
- strftime=''
- xnxlib=''
- chsize=''
- tzset=''
- threaddef=''
- selectdef=''
- threaddir=''
- syslog=''
- novoid=''
- novfork=''
- sunos4=''
- portable=''
- passnam=''
- berknam=''
- usgnam=''
- whoami=''
- termio=''
- termios=''
- fcntl=''
- ioctl=''
- ptem=''
- normsig=''
- sigblock=''
- sigret=''
- sighold=''
- getuidgid=''
- setvbuf=''
- setbuffer=''
- getcwd=''
- getwd=''
- havetlib=''
- getpwent=''
- gethostname=''
- douname=''
- phostname=''
- hostcmd=''
- norelay=''
- isrrn=''
- xthread=''
- rdchk=''
- serverfile=''
- ignoreorg=''
- NNTPSRC=''
- CONFIG=''
- X
- echo "Beginning of configuration questions for trn."
- X: Eunice requires " " instead of "", can you believe it
- echo " "
- X
- X: sanity checks
- PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/bsd'
- export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
- X
- if test ! -t 0; then
- X echo "Type 'sh Configure', not 'sh <Configure'"
- X exit 1
- fi
- X
- X(alias) >/dev/null 2>&1 && \
- X echo "(I see you are using the Korn shell. Some ksh's blow up on Configure," && \
- X echo "especially on exotic machines. If yours does, try the Bourne shell instead.)"
- X
- X
- X: some greps do not return status, grrr.
- echo "grimblepritz" >grimble
- if grep blurfldyick grimble >/dev/null 2>&1 ; then
- X contains=contains
- else
- X if grep grimblepritz grimble >/dev/null 2>&1 ; then
- X contains=grep
- X else
- X contains=contains
- X fi
- fi
- X
- X: the following should work in any shell
- case $contains in
- contains*)
- X echo " "
- X echo "AGH! Grep doesn't return a status. Attempting remedial action."
- X cat >contains <<'EOSS'
- grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
- XEOSS
- chmod +x contains
- esac
- X
- X: first determine how to suppress newline on echo command
- echo "Checking echo to see how to suppress newlines..."
- X(echo "hi there\c" ; echo " ") >.echotmp
- if $contains c .echotmp >/dev/null 2>&1 ; then
- X echo "...using -n."
- X n='-n'
- X c=''
- else
- X cat <<'EOM'
- X...using \c
- XEOM
- X n=''
- X c='\c'
- fi
- echo $n "Type carriage return to continue. Your cursor should be here-->$c"
- read ans
- rm .echotmp
- X
- X: now set up to do reads with possible shell escape
- X: if this does not work on your machine, 1,$s/. myread/read ans/
- cat <<EOSC >myread
- ans='!'
- while expr "X\$ans" : "X!" >/dev/null; do
- X read ans
- X case "\$ans" in
- X !)
- X sh
- X echo " "
- X echo $n "Your answer: $c"
- X ;;
- X !*)
- X set \`expr "X\$ans" : "X!\(.*\)\$"\`
- X sh -c "\$*"
- X echo " "
- X echo $n "Your answer: $c"
- X ;;
- X esac
- done
- XEOSC
- X
- X: general instructions
- cat <<'EOH'
- X
- This installation shell script will examine your system and ask you questions
- to determine how trn and its auxiliary files should be installed. If you
- get stuck on a question, you may use a ! shell escape to start a subshell or
- execute a command. Many of the questions will have default answers in
- square brackets--typing carriage return will give you the default.
- X
- On some of the questions which ask for file or directory names you are
- allowed to use the ~name construct to specify the login directory belonging
- to "name", even if you don't have a shell which knows about that. Questions
- where this is allowed will be marked "(~name ok)".
- X
- Much effort has been expended to ensure that this shell script will run
- on any Unix system. If despite that it blows up on you, your best bet is to
- edit Configure and run it again. (Trying to install trn without having run
- Configure is well nigh impossible.) Also, tell Wayne Davison how he blew it
- X(davison@borland.com).
- X
- This installation script affects things by doing direct variable substitutions
- on some of the files included in this kit. You may edit any of these files as
- the need arises after running this script.
- X
- XEOH
- echo $n "[Type carriage return to continue] $c"
- X. myread
- XXn=$n
- XXc=$c
- X: get old answers, if there is a config file out there
- if test -f ./config.sh; then
- X echo " "
- X dflt=y
- X rp="I see a config.sh file. Do you want to use it to set the defaults? [$dflt]"
- X echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) echo "OK, I'll ignore it.";;
- X *) echo "Fetching default answers from your old config.sh file..."
- X tmp="$n"
- X ans="$c"
- X . ./config.sh
- X n="$tmp"
- X c="$ans"
- X ;;
- X esac
- fi
- X
- n=$Xn
- c=$Xc
- X
- X: get list of predefined functions in a handy place
- echo " "
- if test -f /lib/libc.a; then
- X if test -f /usr/lib/libc.a ; then
- X echo "Found two C libraries: /lib/libc.a and /usr/lib/libc.a"
- X if test -d /usr/convex ; then
- X echo "Ah! This is ConvexOS! We'll use the one in /usr/lib."
- X libc=/usr/lib/libc.a
- X else
- X echo "Hmmm...we'll use the more normal of the two: /lib/libc.a"
- X libc=/lib/libc.a
- X fi
- X else
- X echo "Your C library is in /lib/libc.a. You're normal."
- X if test -f /lib/libc_s.a; then
- X echo "You also have AT&T shared libraries, we'll use those."
- X sharedclib=-lc_s
- X fi
- X libc=/lib/libc.a
- X fi
- else
- X if test -f /lib/libc; then
- X echo "Your C library is in /lib/libc. This might be Domain/OS."
- X libc=/lib/libc
- X else
- X if test -f /lib/Llibc.a; then
- X echo "Your C library is in /lib/Llibc.a. I smell Xenix!"
- X libc=/lib/Llibc.a
- X else
- X if test -f /usr/lib/libc.a; then
- X echo "Your C library is in /usr/lib/libc.a, of all places."
- X libc=/usr/lib/libc.a
- X if test -f /usr/lib/libc_s.a; then
- X echo "You also have AT&T shared libraries, we'll use those."
- X sharedclib=-lc_s
- X fi
- X else
- X if test -f /lib/clib; then
- X echo "Your C library is in /lib/clib. How nonstandard, must be Apollo."
- X libc=/lib/clib
- X else
- X if test -f "$libc"; then
- X echo "Your C library is in $libc, like you said before."
- X else
- X cat <<'EOM'
- X
- I can't seem to find your C library. I've looked for /lib/libc.a and
- X/usr/lib/libc.a, but neither of those are there. Perhaps you can find
- out by reading `man 3 intro' if you have the 'man' facility installed.
- X
- XEOM
- X echo $n "What is the full name of your C library? $c"
- X . myread
- X libc="$ans"
- X fi
- X fi
- X fi
- X fi
- X fi
- fi
- X
- if test -d /usr/bsd43 -o -d /usr/bsd ; then
- X echo " "
- X echo "It appears that you might be running on a RISC/os box."
- X echo $n "Should I pass the -B option to nm [y]? $c"
- X . myread
- X case $ans in
- X n*|f*) bopt='' ;;
- X *) bopt='-B' ;;
- X esac
- fi
- if test -f /bin/smit ; then
- X echo " "
- X echo "It appears that you might be running on an IBM RS/6000 box."
- X echo "We'll be using 'nm -B' to get the symbol lists."
- X bopt='-B'
- fi
- X
- echo " "
- echo $n "Extracting names from $libc for later perusal...$c"
- nm $bopt $libc > nm.list 2>/dev/null
- sed -n -e 's/^.* T _//p' -e 's/^.* T //p' < nm.list > libc.list
- if $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- else
- X sed -n -e 's/^.* D _//p' -e 's/^.* D //p' < nm.list > libc.list
- X if $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- X else
- X $contains .text nm.list | grep -v static | awk '{ print $1 }' > libc.list
- X if $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- X else
- X echo " "
- X echo "nm didn't seem to work right."
- X echo "Trying ar instead..."
- X if ar t $libc | sed -e 's/\.o$//' > libc.list; then
- X echo "Ok."
- X else
- X echo "That didn't work either. Giving up."
- X exit 1
- X fi
- X fi
- X fi
- fi
- rm nm.list
- X: make some quick guesses about what we are up against
- echo " "
- echo $n "Hmm... $c"
- if $contains '^sigvec$' libc.list >/dev/null 2>&1 ; then
- X echo "Looks kind of like a BSD system, but we'll see..."
- X echo exit 0 >bsd
- X echo exit 1 >usg
- X echo exit 1 >v7
- else
- X if $contains '^dup2$' libc.list >/dev/null 2>&1 ; then
- X echo "Looks sort of like a V7 system, but we'll see..."
- X echo exit 1 >bsd
- X echo exit 1 >usg
- X echo exit 0 >v7
- X else
- X echo "Looks kind of like a USG system, but we'll see..."
- X echo exit 1 >bsd
- X echo exit 0 >usg
- X echo exit 1 >v7
- X fi
- fi
- X:
- if test -f /etc/inittab; then
- X echo "You have an inittab file. You must be a USG system!"
- X echo exit 1 >bsd
- X echo exit 0 >usg
- X echo exit 1 >v7
- fi
- if $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
- X cat <<'EOI'
- There is, however, a strange, musty smell in the air that reminds me of
- something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
- XEOI
- X echo "exit 0" >eunice
- X eunicefix=unixtovms
- X eunice=define
- X: it so happens the Eunice I know will not run shell scripts in Unix format
- else
- X echo " "
- X echo "Congratulations. You aren't running Eunice."
- X eunicefix=':'
- X eunice=undef
- X echo "exit 1" >eunice
- fi
- chmod +x bsd usg v7 eunice
- X$eunicefix bsd usg v7 eunice
- X: see how we invoke the C preprocessor
- echo " "
- echo "Checking to see how your C preprocessor is invoked..."
- cat <<'EOT' >testcpp.c
- X#define ABC abc
- X#define XYZ xyz
- ABC+XYZ
- XEOT
- echo 'Maybe "cc -E" will work...'
- cc -E testcpp.c >testcpp.out 2>&1
- if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, it does."
- X cpp='cc -E'
- else
- X echo 'Nope...maybe "cc -P" will work...'
- X cc -P testcpp.c >testcpp.out 2>&1
- X if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, that does."
- X cpp='cc -P'
- X else
- X echo 'Nixed again...maybe "/lib/cpp" will work...'
- X /lib/cpp testcpp.c >testcpp.out 2>&1
- X if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, it works! I was beginning to wonder."
- X cpp='/lib/cpp'
- X else
- X if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Found it! You're on a NeXT, aren't you?"
- X cpp='/lib/cpp'
- X else
- X echo 'Hmm...maybe you already told me...'
- X case "$cpp" in
- X '') ;;
- X *) $cpp testcpp.c >testcpp.out 2>&1;;
- X esac
- X if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, you did! I was beginning to wonder."
- X else
- X echo "Nope. I can't find a C preprocessor. Name one: $c"
- X . myread
- X cpp="$ans"
- X $cpp testcpp.c >testcpp.out 2>&1
- X if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "OK, that will do."
- X else
- X echo "Sorry, I can't get that to work. Go find one."
- X exit 1
- X fi
- X fi
- X fi
- X fi
- X fi
- fi
- rm -f testcpp.c testcpp.out
- X: check for pdp11
- echo " "
- cat <<'EOT' >pdp11.c
- X#ifdef pdp11
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp pdp11.c | grep exit >pdp11
- chmod +x pdp11
- X$eunicefix pdp11
- rm pdp11.c
- if pdp11; then
- X echo "This looks like a pdp11 to me."
- fi
- X: check for ultrix
- cat <<'EOT' >ultrix.c
- X#ifdef ultrix
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp ultrix.c | grep exit >ultrix
- chmod +x ultrix
- X$eunicefix ultrix
- rm ultrix.c
- if ultrix; then
- X echo "Running ultrix, eh?"
- fi
- X
- X: check for uts
- cat <<'EOT' >uts.c
- X#ifdef uts
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp uts.c | grep exit >uts
- chmod +x uts
- X$eunicefix uts
- rm uts.c
- if uts; then
- X echo "This appears to be some kind of System370-type system running UTS."
- X socketlib=-lsocket
- fi
- X
- X: check for sun 4.0
- sunos4=undef
- cat <<'EOT' >sun.c
- X#ifdef sun
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp sun.c | grep exit >sun
- chmod +x sun
- X$eunicefix sun
- rm sun.c
- if sun; then
- X echo "This looks like a sun to me."
- X if test -f /etc/ld.so.cache ; then
- X echo "And it appears you are running SunOS 4.0 or greater."
- X sunos4=define
- X socketlib=
- X rrninclude=
- X fi
- fi
- X: check for hp-ux
- cat <<'EOT' >hp-ux.c
- X#ifdef hpux
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp hp-ux.c | grep exit >hp-ux
- chmod +x hp-ux
- X$eunicefix hp-ux
- rm hp-ux.c
- if hp-ux; then
- X echo "Hewlett-Packard must have built this..."
- X socketlib=-lbsdipc
- fi
- X
- X: check for mips
- cat <<'EOT' >mips.c
- X#if defined(mips) && !defined(ultrix)
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp mips.c | grep exit >mips
- chmod +x mips
- X$eunicefix mips
- rm mips.c
- if mips; then
- X echo "Looks like mips RISC/os..."
- X rrninclude="-DUSG -I/usr/include/bsd"
- X socketlib=-lbsd
- fi
- X: check for stardent
- cat <<'EOT' >stardent.c
- X#if defined(stardent) || defined(ardent) || defined (steller)
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp stardent.c | grep exit >stardent
- chmod +x stardent
- X$eunicefix stardent
- rm stardent.c
- if stardent; then
- X echo "This appears to be a Stardent/Steller/Ardent..."
- X rrninclude="-DUSG"
- X socketlib=
- fi
- X: check for sgi
- cat <<'EOT' >sgi.c
- X#ifdef sgi
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp sgi.c | grep exit >sgi
- chmod +x sgi
- X$eunicefix sgi
- rm sgi.c
- if sgi; then
- X echo "Silicon Graphics must have built this..."
- X if test -f /usr/lib/libsun.a ; then
- X socketlib=-lsun
- X fi
- fi
- X
- X: check for XENIX
- cat <<'EOT' >xenix
- test -f /xenix; exit $?
- XEOT
- chmod +x xenix
- X$eunicefix xenix
- if xenix; then
- X echo "Kinda looks like XENIX....hmmm"
- X rrninclude="-DUSG -DLAI_TCP"
- X socketlib=-lsocket
- X rdchk=define
- X dirtype=dirent
- X dirinc="<dirent.h>"
- else
- X rdchk=undef
- fi
- X
- X: check for Pyramid OSx
- cat <<'EOT' >pyr.c
- X#ifdef pyr
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp pyr.c | grep exit >pyr
- chmod +x pyr
- X$eunicefix pyr
- rm pyr.c
- if pyr; then
- X echo "This looks like a Pyramid to me."
- fi
- X
- X: check for NeXT
- cat <<'EOT' >next.c
- X#ifdef NeXT
- exit 0
- X#else
- exit 1
- X#endif
- XEOT
- X$cpp next.c | grep exit >next
- chmod +x next
- X$eunicefix next
- rm next.c
- if next; then
- X echo "My, you really ARE on a NeXT."
- X addcflags=' -bsd'
- X test=test
- else
- X addcflags=''
- fi
- X
- if bsd; then
- X getuidgid=define
- else
- X getuidgid=undef
- fi
- X
- cat <<'EOT' > s5uniq
- if test -f /bin/uname
- then
- X case `uname -r -m` in
- X "5.3 vax-"*)
- X if [ -f /usr/lib/libnet.a \
- X -a -f /usr/lib/libhdb.a \
- X -a -f /usr/lib/libbbn.a \
- X -a -f /usr/lib/libstr.a ]
- X then
- X exit 0
- X fi;;
- X esac
- fi
- exit 1
- XEOT
- chmod +x s5uniq
- if s5uniq; then
- X echo "This looks like Uniq. What a pity."
- X socketlib="-lnet -lhdb -lbbn -lstr"
- X rrninclude="-DR_UNIQ -DUSG"
- X # -DR_UNIQ and -DUSG are needed for ~nntp/common/clientlib.c
- fi
- X: check for posix
- posix=''
- if usg; then
- X if test -f /lib/libcposix.a; then
- X echo "Your version of System V supports POSIX compatibility."
- X echo "We'll make use of it!"
- X posix=' -Xp'
- X fi
- fi
- X
- X
- X: see if sh knows # comments
- echo " "
- echo "Checking your sh to see if it knows about # comments..."
- if sh -c '#' >/dev/null 2>&1 ; then
- X echo "Your sh handles # comments correctly."
- X shsharp=true
- X spitshell=cat
- X echo " "
- X echo "Okay, let's see if #! works on this system..."
- X echo "#!/bin/echo hi" > try
- X $eunicefix try
- X chmod +x try
- X try > today
- X if test -s today; then
- X echo "It does."
- X sharpbang='#!'
- X else
- X echo "#! /bin/echo hi" > try
- X $eunicefix try
- X chmod +x try
- X try > today
- X if test -s today; then
- X echo "It does."
- X sharpbang='#! '
- X else
- X echo "It doesn't."
- X sharpbang=': use '
- X fi
- X fi
- else
- X echo "Your sh doesn't grok # comments--I will strip them later on."
- X shsharp=false
- X echo "exec grep -v '^#'" >spitshell
- X chmod +x spitshell
- X $eunicefix spitshell
- X spitshell=`pwd`/spitshell
- X echo "I presume that if # doesn't work, #! won't work either!"
- X sharpbang=': use '
- fi
- X
- X: figure out how to guarantee sh startup
- echo " "
- echo "Checking out how to guarantee sh startup..."
- startsh=$sharpbang'/bin/sh'
- echo "Let's see if '$startsh' works..."
- cat >try <<EOSS
- X$startsh
- set abc
- test "$?abc" != 1
- XEOSS
- X
- chmod +x try
- X$eunicefix try
- if try; then
- X echo "Yup, it does."
- else
- X echo "Nope. You may have to fix up the shell scripts to make sure sh runs them."
- fi
- rm -f try today
- X
- X: find out where common programs are
- echo " "
- echo "Locating common programs..."
- pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /usr/etc /usr/5bin /usr/bsd /usr/bsd43"
- cat <<EOSC >loc
- X$startsh
- thing=\$1
- shift
- dflt=\$1
- shift
- for dir in \$*; do
- X case "\$thing" in
- X .)
- X if test -d \$dir/\$thing; then
- X echo \$dir
- X exit 0
- X fi
- X ;;
- X *)
- X if test -f \$dir/\$thing; then
- X echo \$dir/\$thing
- X exit 0
- X fi
- X ;;
- X esac
- done
- echo \$dflt
- exit 1
- XEOSC
- chmod +x loc
- X$eunicefix loc
- loclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep"
- trylist="test inews egrep more pg Mcc nidump ypmatch"
- for file in $loclist; do
- X xxx=`loc $file $file $pth`
- X eval $file=$xxx
- X case "$xxx" in
- X /*)
- X echo $file is in $xxx.
- X ;;
- X *)
- X echo "I don't know where $file is. I hope it's in everyone's PATH."
- X ;;
- X esac
- done
- echo " "
- echo "Don't worry if any of the following aren't found..."
- for file in $trylist; do
- X xxx=`loc $file $file $pth`
- X eval $file=$xxx
- X case "$xxx" in
- X /*)
- X echo $file is in $xxx.
- X ;;
- X *)
- X echo "I don't see $file out there, offhand."
- X ;;
- X esac
- done
- case $egrep in
- egrep)
- X echo "Substituting grep for egrep."
- X egrep=$grep
- X ;;
- esac
- case $test in
- test)
- X echo "Hopefully test is built into your sh."
- X ;;
- X/bin/test)
- X echo " "
- X echo $n 'Is your "test" built into sh? [n] (OK to guess) '"$c"
- X . myread
- X case $ans in
- X y*) test=test ;;
- X esac
- X ;;
- X*)
- X test=test
- X ;;
- esac
- case $echo in
- echo)
- X echo "Hopefully echo is built into your sh."
- X ;;
- X/bin/echo)
- X echo " "
- X echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
- X $echo $n "hi there$c" >foo1
- X echo $n "hi there$c" >foo2
- X if cmp foo1 foo2 >/dev/null 2>&1; then
- X echo "They are compatible. In fact, they may be identical."
- X else
- X echo "They are not compatible--the echo builtin will be used."
- X echo=echo
- X fi
- X $rm -f foo1 foo2
- X ;;
- X*)
- X echo=echo
- X ;;
- esac
- X$echo " "
- X: test yp
- case $ypmatch in
- ypmatch)
- X $echo "I don't see ypmatch out there, so YP is not available. We'll search the"
- X $echo "passwd file the old fashioned way!"
- X ;;
- X*)
- X $ypmatch 513/tcp services > /dev/null 2>/dev/null
- X status=$?
- X if $test $status -ne 0 ; then
- X $echo "YP installed, but not operational. We won't use it."
- X ypmatch=""
- X else
- X $echo "YP installed and operational."
- X fi
- X
- X ;;
- esac
- if $test "$nidump" = "nidump"; then
- X nidump=""
- fi
- if $test "$ypmatch" = "ypmatch"; then
- X ypmatch=""
- fi
- X
- X: decide how portable to be
- case "$portable" in
- define) dflt=y;;
- X*) dflt=n;;
- esac
- X$cat <<'EOH'
- X
- I can set things up so that your shell scripts and binaries are more portable,
- at what may be a noticeable cost in performance. In particular, if you
- ask to be portable, the following happens:
- X
- X 1) shell scripts will rely on the PATH variable rather than using
- X the paths derived above.
- X 2) ~username interpretations will be done at run time rather than
- X by Configure.
- X 3) the system name will be determined at run time, if at all possible.
- X
- XEOH
- X$echo $n "Do you expect to run these scripts and binaries on multiple machines? [$dflt] $c"
- X. myread
- case $ans in
- X'') ans=$dflt;;
- esac
- case $ans in
- X y*) portable=define
- X for file in $loclist; do
- X eval $file=$file
- X done
- X ;;
- X *) portable=undef ;;
- esac
- X
- X: set up shell script to do ~ expansion
- cat >filexp <<EOSS
- X$startsh
- X: expand filename
- case \$1 in
- X~/*|~)
- X $echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
- X ;;
- X~*)
- X if $test -f /bin/csh; then
- X /bin/csh -f -c "glob \$1"
- X $echo ""
- X else
- X name=\`$expr x\$1 : '..\([^/]*\)'\`
- X if $test "$ypmatch" != ""; then
- X dir=\`$ypmatch \$name passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/"'\`
- X elif $test "$nidump" != ""; then
- X dir=\`$nidump passwd / | $sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
- X fi
- X if $test "\$dir" = ""; then
- X dir=\`$sed </etc/passwd -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
- X fi
- X if $test ! -d "\$dir"; then
- X me=\`basename \$0\`
- X $echo "\$me: can't locate home directory for: \$name" >&2
- X exit 1
- X fi
- X case \$1 in
- X */*)
- X $echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
- X ;;
- X *)
- X $echo \$dir
- X ;;
- X esac
- X fi
- X ;;
- X*)
- X $echo \$1
- X ;;
- esac
- XEOSS
- chmod +x filexp
- X$eunicefix filexp
- X
- X: try to deal with domains
- X$cat << 'EOH'
- X
- Please enter your domain name. This will be used in conjunction with the
- site name for return addresses on news articles and mail. If you use the
- X4.3ism of having your domain in your hostname, all the posting programs
- will figure this out on the fly, so don't worry.
- X
- XExamples of some valid domains:
- X berkeley.edu
- X nasa.gov
- XExample of an invalid domain in common use:
- X uucp
- XEOH
- X
- case "$domain" in
- X'') dflt="uucp";;
- X*) dflt="$domain" ;;
- esac
- X$echo $n "Your domain: [$dflt] $c"
- X. myread
- case "$ans" in
- X'') domain="$dflt";;
- X*) domain="$ans" ;;
- esac
- X
- X: now get the site name
- X$echo " "
- X$echo "Figuring out site name..."
- X$echo 'Maybe "hostname" will work...'
- if ans=`sh -c hostname 2>&1` ; then
- X thissite=$ans
- X hostcmd=hostname
- else
- X $echo 'No, maybe "uuname -l" will work...'
- X if ans=`sh -c 'uuname -l' 2>&1` ; then
- X thissite=$ans
- X hostcmd='uuname -l'
- X else
- X $echo 'Strange. Maybe "uname -n" will work...'
- X if ans=`sh -c 'uname -n' 2>&1` ; then
- X thissite=$ans
- X hostcmd='uname -n'
- X else
- X $echo 'Oh well, maybe I can mine it out of whoami.h...'
- X if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
- X thissite=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
- X hostcmd="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
- X else
- X case "$sitename" in
- X '') $echo "Does this machine have an identity crisis or something?"
- X hostcmd=''
- X ;;
- X *) $echo "Well, you said $sitename before..."
- X thissite="$sitename"
- X ;;
- X esac
- X fi
- X fi
- X fi
- fi
- X: you do not want to know about this
- set $thissite
- thissite=$1
- X
- X: translate upper to lower case. This is mostly to help UUCP work right.
- case $thissite in
- X *[A-Z]*)
- X thissite=`$echo $thissite | tr '[A-Z]' '[a-z]'`
- X $echo "(Normalizing case in your site name)"
- X ;;
- esac
- X
- X: verify site name and allow them to override it
- if $test "$thissite" ; then
- X $echo 'Your site name appears to be "'$thissite'".'
- else
- X thissite='unknown'
- fi
- case "$hostfile" in
- X/*) dflt="$hostfile" ;;
- X*) case "$sitename" in
- X '') dflt="$thissite" ;;
- X *) dflt="$sitename" ;;
- X esac
- esac
- X$cat <<'EOM'
- X
- In some cases it is not desirable to use the actual site name in your return
- addresses (if, for example, all mail gets routed first to one site). In this
- case trn allows you to either hard-wire a site name or read the site name from
- a file. To indicate a file, start the name with a slash (e.g. /etc/sitename).
- To use just your domain name, re-enter it here. A period-less site name will
- automatically get your domain name added to it.
- X
- XEOM
- while $test $dflt ; do
- X $echo $n "What site name goes in return addresses? [$dflt] $c"
- X . myread
- X case $ans in
- X '') ans=$dflt;;
- X esac
- X case $ans in
- X /*)
- X if $test -f $ans ; then
- X hostfile="$ans"
- X hostcmd="$cat $ans"
- X sitename=`$hostcmd`
- X $echo "Trn will read the site name from $ans: $sitename."
- X dflt=''
- X else
- X $echo "Unable to locate $ans."
- X fi
- X ;;
- X *) hostfile=''
- X if $test "X$thissite" = "X$ans" ; then
- X sitename="$thissite"
- X $echo "Using the site name derived by $hostcmd: $sitename."
- X else
- X hostcmd=''
- X sitename="$ans"
- X $echo "Using a hard-wired site name: $sitename."
- X fi
- X dflt=''
- X ;;
- X esac
- done
- X
- if $test $portable = "undef" ; then
- X case $sitename in
- X *.*) ;;
- X *) sitename=$sitename.$domain
- X ;;
- X esac
- fi
- X
- X: get organization name
- longshots='/usr/src/new /usr/src/local /usr/local/src'
- case "$orgname" in
- X'') if xxx=`loc news/src/defs.h x $longshots`; then
- X dflt=`$sed -n 's/^.*MYORG[ ]*"\(.*\)".*$/\1/p' $xxx`
- X else
- X dflt='no default'
- X fi
- X ;;
- X*) dflt="$orgname";;
- esac
- X$cat << 'EOH'
- X
- Please type the name of your organization as you want it to appear on the
- Organization line of outgoing articles. (It's nice if this also specifies
- your location. Your city name is probably sufficient if well known.)
- XFor example:
- X
- X University of Southern North Dakota, Hoople
- X
- You may also put the name of a file, as long as it begins with a slash.
- XFor example:
- X
- X /etc/organization
- X
- XEOH
- orgname="no default"
- while test "X$orgname" = "Xno default"; do
- X $echo $n "Organization: [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') orgname="$dflt";;
- X *) orgname="$ans" ;;
- X esac
- done
- X
- X: Decide whether to ignore the ORGANIZATION environment variable
- cat <<'EOM'
- X
- Trn normally looks in the environment variables NEWSORG and ORGANIZATION
- for an overriding organization name. However, if your operating system
- reserves the environment variable ORGANIZATION for non-News purposes,
- you will want to ignore it and only have trn check for NEWSORG.
- X
- XEOM
- X
- case "$ignoreorg" in
- define) dflt=y ;;
- X*) dflt=n ;;
- esac
- X$echo $n "Should we ignore ORGANIZATION? [$dflt] $c"
- X. myread
- case "$ans" in
- X'') ans="$dflt";;
- esac
- case "$ans" in
- y*) ignoreorg=define ;;
- X*) ignoreorg=undef ;;
- esac
- X
- X: get news administrator name
- case "$newsadmin" in
- X'')
- X if $contains "^news:" /etc/passwd >/dev/null 2>&1 ; then
- X dflt=news
- X else
- X if $contains "^usenet:" /etc/passwd >/dev/null 2>&1 ; then
- X dflt=usenet
- X else
- X if eunice; then
- X dflt=system
- X else
- X dflt=root
- X fi
- X fi
- X fi
- X ;;
- X*) dflt="$newsadmin"
- X ;;
- esac
- cat <<'EOM'
- X
- Many systems keep their news in a private directory, or have a non-superuser
- in charge of administering news. (If you don't have such a user, take the
- default answer.) What is the login name (not directory) that is used for news
- XEOM
- X$echo $n "administration? [$dflt] $c"
- X. myread
- newsadmin="$ans"
- case $newsadmin in
- X'') newsadmin=$dflt ;;
- esac
- case $newsadmin in
- root) isadmin=undef ;;
- X*) isadmin=define ;;
- esac
- X
- X: figure out news library
- case "$lib" in
- X'')
- X dflt=/usr/lib/news
- X ;;
- X*) dflt=$lib ;;
- esac
- libexp=$lib
- libexp='blurfl/dyick'
- while $test ! -d "$libexp"; do
- X $echo " "
- X case "$libexp" in
- X blurfl*) ;;
- X *) $echo "Directory $libexp not found";;
- X esac
- X $echo $n "Where is your news library (~name okay)? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X lib="$ans"
- X case $lib in
- X ~*)
- X libexp=`filexp $lib`
- X $echo "(That is $libexp on this particular system.)"
- X case $portable in
- X undef) lib=$libexp ;;
- X esac
- X ;;
- X *)
- X libexp=$lib
- X ;;
- X esac
- done
- X
- X: locate the inews program
- ans='no default'
- while $test ! -f "$ans" ; do
- X case $ans in
- X 'no default') ;;
- X *) $echo "$ans does not appear to exist." ;;
- X esac
- X case "$inews" in
- X ''|inews)
- X if $test -f $libexp/inews; then
- X dflt=$libexp/inews
- X else
- X dflt='no default'
- X fi
- X ;;
- X *) dflt="$inews" ;;
- X esac
- X $echo " "
- X $echo $n "Where is the inews program located on your system? [$dflt] $c"
- X . myread
- X case $ans in
- X '') ans=$dflt ;;
- X esac
- done
- inews=$ans
- X
- X: determine where manual pages go
- case "$mansrc" in
- X'')
- X dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
- X ;;
- X*) dflt="$mansrc"
- X ;;
- esac
- mansrc='blurfl/dyick'
- while $test ! -d "$mansrc" ; do
- X case $mansrc in
- X blurfl*) ;;
- X *) $echo "$mansrc does not appear to exist." ;;
- X esac
- X $echo " "
- X $echo $n "Where do the manual pages (source) go? [$dflt] $c"
- X . myread
- X mansrc=`filexp "$ans"`
- X case $mansrc in
- X '') mansrc=$dflt ;;
- X esac
- done
- case "$mansrc" in
- X*l)
- X manext=l
- X ;;
- X*n)
- X manext=n
- X ;;
- X*)
- X manext=1
- X ;;
- esac
- X
- X: determine where mail is spooled
- case "$maildir" in
- X'')
- X dflt=`loc . /usr/spool/mail /usr/spool/mail /usr/mail`
- X ;;
- X*) dflt="$maildir"
- X ;;
- esac
- case "$dflt" in
- X*%L*|*%~*) ;;
- X
- X*) dflt="$dflt/%L"
- esac
- X$cat <<'EOM'
- X
- Trn needs to know where to find yet-to-be-read mail. Sendmail sites
- use /usr/spool/mail/%L (where '%L' is the user's login name). Some
- MMDF sites use /usr/%L/.mail instead.
- X
- XEOM
- X$echo $n "Where is yet-to-be-read mail spooled? [$dflt] $c"
- X. myread
- maildir="$ans"
- case $maildir in
- X'') maildir=$dflt ;;
- esac
- X
- X: find out how to find out full name
- X$echo " "
- case "$berknam" in
- define)
- X dflt=y;;
- undef)
- X dflt=n;;
- X*)
- X if bsd || xenix; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X ;;
- esac
- X$echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
- X$echo $n "thing after ':' in GCOS field)? [$dflt] $c"
- X. myread
- case $ans in
- X '') ans=$dflt ;;
- esac
- case $ans in
- X y*)
- X passnam=define
- X berknam=define
- X usgnam=undef
- X nametype=bsd
- X ;;
- X *)
- X $echo " "
- X case "$usgnam" in
- X define)
- X dflt=y;;
- X undef)
- X dflt=n;;
- X *)
- X if usg; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X ;;
- X esac
- X $echo "Does your passwd file keep full names in USG format (name sandwiched"
- X $echo $n "between a '-' and a '(')? [$dflt] $c"
- X . myread
- X case $ans in
- X '') ans=$dflt ;;
- X esac
- X case $ans in
- X n*)
- X $echo "Full name will be taken from ~/.fullname"
- X passnam=undef
- X berknam=undef
- X usgnam=undef
- X nametype=other
- X ;;
- X *)
- X passnam=define
- X berknam=undef
- X usgnam=define
- X nametype=usg
- X ;;
- X esac
- X ;;
- esac
- X
- X: see if we should throw a -i into the Makefile
- X$echo " "
- if pdp11; then
- X if $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1 ; then
- X $echo $n "Your system appears to have separate I and D space. Is this true? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) iandd='' ;;
- X *) iandd=' -i' ;;
- X esac
- X else
- X $echo "Your system appears to NOT have separate I and D space."
- X $echo $n "Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) iandd=' -i' ;;
- X *) iandd='' ;;
- X esac
- X fi
- else
- X $echo "Not a pdp11--assuming no separate I and D."
- X iandd=''
- fi
- X
- X: set the right options for cc and include the x library for XENIX
- if xenix; then
- X if $test -d /lib/386 ; then
- X iandd=" -M3e"
- X else
- X: iandd=" -M2let8 -LARGE -F 3000"
- X iandd=" -Ml2et32 -LARGE -F B000"
- X fi
- X xnxlib=-lx
- X chsize=define
- else
- if $test -r /lib/libx.a -a -f /xenix ; then
- X $echo "Found Xenix library; using chsize()"
- X xnxlib=-lx
- X chsize=define
- else
- X xnxlib=''
- X chsize=undef
- fi
- fi
- X
- X: see if we need a special compiler
- if usg; then
- X case "$cc" in
- X '')
- X case "$Mcc" in
- X /*) dflt='Mcc'
- X ;;
- X *)
- X if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
- X dflt='cc -M'
- X else
- X dflt='cc'
- X fi
- X ;;
- X esac
- X ;;
- X *) dflt="$cc";;
- X esac
- X $cat <<'EOM'
- X
- On some systems the default C compiler will not resolve multiple global
- references that happen to have the same name. On some such systems the
- X"Mcc" command may be used to force these to be resolved. On other systems
- a "cc -M" command is required. If gcc is available you might want to use
- XEOM
- X $echo $n "that. What command will force resolution on this system? [$dflt] $c"
- X . myread
- X cc="$ans"
- X case "$cc" in
- X '') cc="$dflt";;
- X *) cflags='';;
- X esac
- else
- X case "$cc" in
- X '') dflt="cc";;
- X *) dflt="$cc";;
- X esac
- X cat <<'EOM'
- X
- We need a C compiler that can resolve multiple global references, and since
- this isn't a USG system, cc should work just fine. However, you may want to
- XEOM
- X $echo $n "use gcc or something else. What C compiler should we use? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X *) cflags='';;
- X esac
- X cc="$ans"
- fi
- X
- X: see about the C options
- case "$cflags" in
- X'') dflt="-O$posix$iandd$addcflags";;
- X*) dflt="$cflags";;
- esac
- cat <<EOM
- X
- The following C flags should do the job on your system. However, if you need
- to omit a -O, add a -traditional or whatever, here's your chance. What flags
- XEOM
- X$echo $n "does $cc need? [$dflt] $c"
- X. myread
- case "$ans" in
- X'') ans="$dflt";;
- esac
- cflags="$ans"
- X
- X: index or strcpy
- X$echo " "
- if $contains '^index$' libc.list >/dev/null 2>&1 ; then
- X $echo "Your system appears to use index() and rindex() rather than strchr()"
- X $echo $n "and strrchr(). Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) strchr='define' ;;
- X *) strchr='undef' ;;
- X esac
- else
- X $echo "Your system appears to use strchr() and strrchr() rather than index()"
- X $echo $n "and rindex(). Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) strchr=undef ;;
- X *) strchr=define ;;
- X esac
- fi
- X
- X: bcopy/bzero or memcpy/memset
- X$echo " "
- if $contains '^bcopy$' libc.list >/dev/null 2>&1 ; then
- X $echo "Your system appears to use bcopy() and bzero() rather than memcpy()"
- X $echo $n "and memset(). Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) memcpy='define' ;;
- X *) memcpy='undef' ;;
- X esac
- else
- X $echo "Your system appears to use memcpy() and memset() rather than bcopy()"
- X $echo $n "and bzero(). Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) memcpy='undef' ;;
- X *) memcpy='define' ;;
- X esac
- fi
- X
- X: check for S5-style timezone handling - current offset from GMT in
- X: external variable "timezone" rather than gotten with "ftime".
- X$echo " "
- if $contains tzname /usr/include/time.h >/dev/null 2>&1 ; then
- X $echo "Your system appears to get the current timezone's offset from GMT by using the"
- X $echo "external variable timezone rather than by calling ftime() or gettimeofday()."
- X $echo $n "Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) tzset='undef' ;;
- X *) tzset='define' ;;
- X esac
- else
- X $echo "Your system appears to get the current timezone's offset from GMT by calling"
- X $echo "ftime() or gettimeofday() rather than from the external variable timezone."
- X $echo $n "Is this correct? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) tzset='define' ;;
- X *) tzset='undef' ;;
- X esac
- fi
- X
- X: determine how to determine when a file is a mailbox
- case "$mboxchar" in
- X'') dflt=F;;
- X*) dflt="$mboxchar";;
- esac
- X$cat <<'EOM'
- X
- In saving articles, trn wants to differentiate between saving to mailbox
- format files and normal files. It does this by examining the first character
- of the file in question. On most systems the first line starts "From...",
- so the first character is F. On other systems there are magic cookies like
- control codes between articles, so one of those would be first. For example,
- MMDF messages are separated with lines of 4 control-A's. On your system, if a
- XEOM
- X$echo $n "file is in mailbox format, what is the first character of that file? [$dflt] $c"
- X. myread
- mboxchar="$ans"
- case $mboxchar in
- X'') mboxchar="$dflt" ;;
- esac
- case $mboxchar in
- X'F') ;;
- X"$CTRLA") ;;
- X*) cat <<'EOM'
- You will need to edit the shell script mbox.saver to properly append an
- article to a mailbox. The arguments to the script are documented in
- XEOM
- X case $shsharp in
- X false)
- X $echo "comments in mbox.saver.std."
- X ;;
- X true)
- X $echo "comments in the shell script itself."
- X ;;
- X esac
- esac
- X$rm -f grimble
- X: where do we get termlib routines from
- X$echo " "
- ans=`loc libcurses.a x /usr/lib /usr/local/lib /lib`
- case "$ans" in
- X/*)
- X if test -f /bin/smit; then
- X termlib='-lcurses'
- X havetlib=define
- X $echo "Using -lcurses and assuming terminfo, since this looks like AIX."
- X else
- X ar t $ans >grimble
- X if $contains tputs grimble >/dev/null 2>&1; then
- X termlib='-lcurses'
- X havetlib=define
- X $echo "Terminfo library found."
- X else
- X ans=x
- X fi
- X fi
- X ;;
- esac
- case "$ans" in
- x)
- X ans=`loc libtermlib.a x /usr/lib /usr/local/lib /lib`
- X case "$ans" in
- X /usr/lib*|/lib*)
- X termlib='-ltermlib'
- X havetlib=define
- X $echo "Termlib library found."
- X ;;
- X /*)
- X termlib="$ans"
- X havetlib=define
- X $echo "Termlib library found."
- X ;;
- X *)
- X if xenix; then
- X ans=/lib/Llibtermcap.a
- X else
- X ans=`loc libtermcap.a x /usr/lib /usr/local/lib /lib`
- X fi
- X case "$ans" in
- X /usr/lib*|/lib*)
- X termlib='-ltermcap'
- X havetlib=define
- X $echo "Termcap library found."
- X ;;
- X /*)
- X termlib="$ans"
- X havetlib=define
- X $echo "Termcap library found."
- X ;;
- X *)
- X case "$termlib" in
- X '')
- X $echo $n "Your system appears to NOT have termlib-style routines. Is this true? [y] $c"
- X . myread
- X case $ans in
- X n*|f*) havetlib=define
- X $echo "Then where are the termlib-style routines kept (specify either -llibname"
- X $echo $n " or full pathname (~name ok))? $c"
- X . myread
- X termlib=`filexp $ans`
- X ;;
- X *) havetlib=undef
- X termlib=''
- X $echo "You will have to play around with term.c then."
- X ;;
- X esac
- X $echo " "
- X ;;
- X *) $echo "You said termlib was $termlib before."
- X ;;
- X esac
- X ;;
- X esac
- X ;;
- X esac
- X ;;
- esac
- X: see if there is a whoami file
- if $test -r /usr/include/whoami.h ; then
- X whoami=define
- X $echo "whoami.h found."
- else
- X whoami=undef
- fi
- X
- X: see if this is a termio/termios/sgtty system
- if ultrix || sun || pyr ; then
- X termio=undef
- X termios=undef
- X $echo "Using sgtty.h"
- else
- if $test -r /usr/include/termio.h ; then
- X termio=define
- X termios=undef
- X $echo "termio.h found."
- else
- if test -d /usr/convex ; then
- X termio=undef
- X termios=define
- X $echo "termios.h found."
- else
- if $test -r /usr/include/sgtty.h ; then
- X termio=undef
- X termios=undef
- X $echo "sgtty.h found."
- else
- X termio=undef
- X termios=undef
- X $echo "Neither termio.h nor sgtty.h found--you could have problems."
- fi
- fi
- fi
- fi
- X
- X: see if this system has fcntl
- if $test -r /usr/include/fcntl.h ; then
- X fcntl=define
- X $echo "fcntl.h found."
- else
- X fcntl=undef
- X $echo "No fcntl.h found, but that's ok."
- fi
- X
- X: see if ioctl defs are in sgtty/termio or sys/ioctl
- if $test -r /usr/include/sys/ioctl.h ; then
- X ioctl=define
- X $echo "sys/ioctl.h found."
- else
- X ioctl=undef
- X $echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
- fi
- X
- X: see if ptem.h exists
- if $test -r /usr/include/sys/ptem.h ; then
- X ptem=define
- X $echo "sys/ptem.h found."
- else
- X ptem=undef
- fi
- X
- X: see if the system has sigblock
- if $contains '^sigblock$' libc.list >/dev/null 2>&1 ; then
- X if sgi; then
- X $echo "sigblock() found and ignored on this Silicon Graphics box"
- X sigblock=undef
- X else
- X $echo "sigblock() found."
- X sigblock=define
- X fi
- else
- X sigblock=undef
- fi
- X
- X: see if the system has setbuffer
- if $contains '^setbuffer$' libc.list >/dev/null 2>&1 ; then
- X $echo "setbuffer() found."
- X setvbuf=undef
- X setbuffer=define
- else
- X: see if the system has setvbuf
- if $contains '^setvbuf$' libc.list >/dev/null 2>&1 ; then
- X $echo "setvbuf() found."
- X setvbuf=define
- X setbuffer=undef
- else
- X $echo "neither setbuffer() or setvbuf() found, punting to standard buffers."
- X setvbuf=undef
- X setbuffer=undef
- fi
- fi
- X
- X: see if the system has getwd
- if $contains '^getwd$' libc.list >/dev/null 2>&1 ; then
- X $echo "getwd() found."
- X getcwd=undef
- X getwd=define
- else
- X: see if the system has getcwd
- if $contains '^getcwd$' libc.list >/dev/null 2>&1 ; then
- X $echo "getcwd() found."
- X getcwd=define
- X getwd=undef
- else
- X getcwd=undef
- X getwd=undef
- fi
- fi
- X
- X: see if there is a vfork
- if $contains '^vfork$' libc.list >/dev/null 2>&1 ; then
- X $echo "vfork() found."
- X novfork='undef'
- X if sgi; then
- X $echo "However, IRIX vfork() is buggy. We'll use fork() instead."
- X novfork='define'
- X fi
- else
- X if next; then
- X $echo "I know NeXTs have vfork()!"
- X novfork='undef'
- X else
- X $echo "No vfork() found--will use fork() instead."
- X novfork='define'
- X fi
- fi
- X
- X: check for rename
- if $contains '^rename$' libc.list >/dev/null 2>&1 ; then
- X $echo "rename() found."
- X rename='define'
- else
- X $echo "No rename() found -- we'll emulate it."
- X rename='undef'
- fi
- X
- X: check for ftruncate
- if $contains '^ftruncate$' libc.list >/dev/null 2>&1 ; then
- X $echo "ftruncate() found."
- X ftruncate='define'
- else
- X $echo "No ftruncate() found -- we'll try to fake it."
- X ftruncate='undef'
- fi
- X
- X: check for usleep or select
- if $contains '^usleep$' libc.list >/dev/null 2>&1 ; then
- X $echo "usleep() found."
- X usleep='define'
- X uselect='undef'
- else
- X usleep='undef'
- X if $contains '^select$' libc.list >/dev/null 2>&1 ; then
- X $echo "No usleep() found -- we'll use select to emulate it."
- X uselect='define'
- X else
- X $echo "No usleep() found -- we'll use sleep() instead."
- X uselect='undef'
- X fi
- fi
- X
- X: check for strftime
- if $contains '^strftime$' libc.list >/dev/null 2>&1 ; then
- X $echo "strftime() found."
- X strftime='define'
- else
- X $echo "No strftime() found -- we'll emulate it."
- X strftime='undef'
- fi
- X
- X: see if YP could be running here
- if $contains 'yp_master$' libc.list >/dev/null 2>&1 ; then
- X $echo "YP may be running -- will use getpwent(), just in case."
- X getpwent='define'
- else
- X: see if there is a getpwent
- if $contains '^getpwent$' libc.list >/dev/null 2>&1 ; then
- X $echo "getpwent() found."
- X getpwent='define'
- else
- X $echo "No getpwent() found--will use getpw() instead."
- X getpwent='undef'
- fi
- fi
- X
- X: default
- sigret=void
- X: determine type of signal function
- if next; then
- X sigret=int
- else
- if stardent || sgi ; then
- X sigret=void
- else
- if test -f /usr/include/signal.h ; then
- X $cpp /usr/include/signal.h >sigtest
- else
- if test -f /usr/include/sys/signal.h ; then
- X $cpp /usr/include/sys/signal.h >sigtest
- fi
- fi
- if $contains 'int[^A-Za-z]*signal' sigtest >/dev/null 2>&1 ; then
- X sigret=int
- fi
- fi
- fi
- X$echo "signal() returns $sigret on this system."
- X: see how we will look up site name
- douname=undef
- gethostname=undef
- phostname=undef
- if $test ! "X$hostfile" = X ; then
- X gethostname=define
- else
- if $test "X$hostcmd" = X ; then
- X : it is already compiled in
- else
- if $contains '^gethostnam' libc.list >/dev/null 2>&1 ; then
- X $echo "gethostname() found."
- X gethostname=define
- else
- X if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
- X $echo "uname() found."
- X douname=define
- X else
- X case $hostcmd in
- X '') ;;
- X *)
- X $cat <<EOT
- X
- There is no gethostname() or uname() on this system. You have two
- possibilites at this point:
- X
- X1) You can have your site name ($sitename) compiled into trn, which lets
- X trn start up faster, but makes your binaries non-portable, or
- X2) you can have trn use a
- X
- X popen("$hostcmd","r")
- X
- X which will start slower but be more portable.
- X
- Option 1 will use whoami.h if you have one. If you want option 2 but with
- a different command, you can edit config.h after this shell script is done.
- X
- XEOT
- X case "$phostname" in
- X define) dflt=n;;
- X undef) dflt=y;;
- X '')
- X case $portable in
- X define) dflt=n ;;
- X *) dflt=y ;;
- X esac
- X ;;
- X esac
- X $echo $n "Do you want your site name compiled in? [$dflt] $c"
- X . myread
- X case $ans in
- X '') ans=$dflt;;
- X esac
- X case $ans in
- X n*) phostname=define ;;
- X *) hostcmd='' phostname=undef;;
- X esac
- X ;;
- X esac
- X case $hostcmd in
- X '')
- X case $whoami in
- X define)
- X $echo 'No hostname function--using whoami.h.'
- X ;;
- X undef)
- X $echo 'No hostname function--hardwiring "'$sitename'".'
- X ;;
- X esac
- X ;;
- X esac
- X fi
- fi
- fi
- fi
- X
- X: see if we need -ljobs and if we have sigset, etc.
- if $test -r /usr/lib/libjobs.a -o -r /usr/local/lib/libjobs.a ; then
- X $echo "Jobs library found."
- X normsig=undef
- X jobslib='-ljobs'
- else
- X if bsd; then
- X $echo "No jobs library found. (I suppose this is at least 4.2...)"
- X else
- X $echo "No jobs library found. (That's okay, we all have our faults.)"
- X fi
- X if $contains '^sigset$' libc.list >/dev/null 2>&1 ; then
- X $echo "However, sigset() does exist, so we'll make use of it."
- X normsig=undef
- X else
- X normsig=define
- X fi
- X jobslib=''
- fi
- X: use sighold and sigrelse?
- if $contains '^sighold$' libc.list >/dev/null 2>&1 ; then
- X $echo "sighold() found"
- X sighold=define
- X else
- X sighold=undef
- fi
- X: No Steve jokes...
- if next; then
- X jobslib='-lsys_s'
- fi
- X: see if there are directory access routines out there
- X ndirlib=''
- X libndir=undef
- X if $contains '^readdir$' libc.list >/dev/null 2>&1 ; then
- X $echo "readdir() found."
- X usendir=undef
- X ndirc=''
- X ndiro=''
- X if sgi ; then
- X dirtype=direct
- X dirinc="<sys/dir.h>"
- X $echo "Using direct directory structure."
- X else
- X if $test -r /usr/include/dirent.h ; then
- X $echo "Using dirent directory structure."
- X dirtype=dirent
- X dirinc="<dirent.h>"
- X else
- X $echo "Using direct directory structure."
- X dirtype=direct
- X dirinc="<sys/dir.h>"
- X fi
- X fi
- X else
- X if xenix; then
- X $echo "Using Xenix readdir() from -lx."
- X usendir=undef
- X ndirc=''
- X ndiro=''
- X dirtype=direct
- X dirinc="<sys/ndir.h>"
- X $echo "Using direct directory structure."
- X else
- X if $test -r /usr/lib/libndir.a -o -r /usr/local/lib/libndir.a ; then
- X $echo "ndir library found."
- X if $test -r /usr/lib/libndir.a; then
- X ndirlib='-lndir'
- X else
- X ndirlib="/usr/local/lib/libndir.a"
- X fi
- X libndir=define
- X usendir=undef
- X ndirc=''
- X ndiro=''
- X dirtype=direct
- X dirinc="<ndir.h>"
- X else
- X $echo "No ndir library and no readdir()--using ./ndir.c."
- X usendir=define
- X ndirc='ndir.c'
- X ndiro='ndir.o'
- X dirtype=direct
- X fi
- X fi
- fi
- X
- X: check if they want threads by default
- case "$threaddef" in
- X F*) dflt="n";;
- X *) dflt="y";;
- esac
- X$cat <<'EOM'
- X
- Trn has two distinct operating modes (selected by the -x option):
- traditional rn and threaded rn. If you like, trn will check the first
- letter of the command name and default to threaded mode (-x) if it is
- a 't', or run as traditional rn (+x) if it isn't (this lets you install
- as both trn and rn, linked together). Otherwise, you can install trn
- to default to threaded rn (-x) no matter what its name is. Would you
- XEOM
- X$echo $n "prefer the latter? (defaults to -x, regardless of name)? [$dflt] $c"
- X. myread
- case "$ans" in
- X'') ans="$dflt";;
- esac
- case "$ans" in
- X n*|f*) threaddef='FALSE'
- X ans=' when -x is specified';;
- X *) threaddef='TRUE'
- X ans='';;
- esac
- X: check if they want the thread selector used by default
- case "$selectdef" in
- X F*) dflt="n";;
- X *) dflt="y";;
- esac
- X$cat <<'EOM'
- X
- When the -X option is specified, trn will set the default command
- for starting a newsgroup to be the thread selector. Should the -X
- XEOM
- X$echo $n "option be on by default$ans? [$dflt] $c"
- X. myread
- case "$ans" in
- X'') ans="$dflt";;
- esac
- case "$ans" in
- X n*|f*) selectdef='FALSE';;
- X *) selectdef='TRUE';;
- esac
- X: check if they have and want to use syslog for the log file in mthreads
- if $contains '^syslog$' libc.list >/dev/null 2>&1 ; then
- X case $syslog in
- X '') dflt=n ;;
- X *) dflt=y ;;
- X esac
- X $echo " "
- X $echo "Mthreads can either use a custom log file or the syslog functions for"
- X $echo $n "maintaining its log messages. Would you prefer to use syslog? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X case $ans in
- X n*) syslog='' ;;
- X *) case $syslog in
- X LOG_*) dflt="$dflt" ;;
- X *) dflt=LOG_NEWS ;;
- X esac
- X $cat <<'EOM'
- X
- If your syslog has LOG_NEWS or LOG_DAEMON, you'll probably want to use
- one of these for your logging. If it doesn't, accept the default and
- XEOM
- X $echo $n "we'll figure that out later. Your choice? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X syslog="$ans"
- X ;;
- X esac
- else
- X syslog=''
- fi
- X
- X: locate spool directory and check if rrn
- case "$isrrn" in
- define)
- X dflt="y";;
- X*)
- X dflt="n";;
- esac
- isrrn=''
- while $test -z "$isrrn" ; do
- X $echo " "
- X $echo $n "Do you want to build the NNTP version of trn? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X case "$ans" in
- X n*)
- X isrrn=undef
- X xthread=undef
- X serverspool=''
- X ;;
- X y*)
- X isrrn=define
- X case "$xthread" in
- X define)
- X dflt="y";;
- X *)
- X dflt="n";;
- X esac
- X $echo " "
- X $echo "Do you want to use the (unofficial) XTHREAD command to grab the thread files"
- X $echo $n "via NNTP instead of using a local database? (Requires a modified NNTP!) [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X case "$ans" in
- X y*) xthread=define
- X case "$serverspool" in
- X '') dflt="n";;
- X *) dflt="y";;
- X esac
- X $cat <<'EOM'
- X
- The client machines won't need to run mthreads at all then. As such, you
- have the option of creating the server version of mthreads, or nothing at
- XEOM
- X $echo $n "all. Do you want to create mthreads for the server? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X case "$ans" in
- X y*) case "$serverspool" in
- X '') dflt="/usr/spool/news";;
- X *) dflt="$serverspool";;
- X esac
- X $echo " "
- X $echo $n "What directory does the SERVER spool news into? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X serverspool="$ans"
- X ;;
- X *) serverspool=''
- X ;;
- X esac
- X ;;
- X *) xthread=undef
- X serverspool=''
- X $echo "Ok, mthreads will also be an NNTP client."
- X ;;
- X esac
- X spool=/tmp
- X $echo "net.foobar 00001 00001 y" > .falseactive
- X
- X case "$serverfile" in
- X '') dflt="no default" ;;
- X *) dflt="$serverfile";;
- X esac
- X
- X $cat <<'EOM'
- X
- Trrn determines the machine to use as a news server by two means:
- X
- XFirst: It examines the environment variable NNTPSERVER for a machine name.
- X If present, this name is used in preference to the default.
- X
- XElse: It uses the default machine name, which is either read from a file
- X or compiled into trn.
- X
- It is your choice whether you wish the default machine name to be read
- from a file or specified directly. To distinguish the two, a filename
- must start with a slash or a tilde, and it must already exist with the
- server name in it (it can contains comments (#) and blank lines also).
- Any other answer is assumed to be a machine name. If you use an alias
- X(such as "news-server") you can use your nameserver to map the name to
- the actual machine.
- X
- XEOM
- X
- X while : ; do
- X $echo $n "Enter the file name (~name ok) or machine name: [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X ans=`filexp "$ans"`
- X case "$ans" in
- X /*) $test -r $ans && break
- X $echo "File $ans does not exist."
- X ;;
- X *) break
- X ;;
- X esac
- X done
- X serverfile="$ans"
- X
- X case "$NNTPSRC" in
- X '') dflt="no default";;
- X *) dflt="$NNTPSRC";;
- X esac
- X
- X ans='blurfl/dyick'
- X while $test ! -d "$ans"; do
- X $echo " "
- X $echo $n "Enter the pathname of the NNTP source directory: [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X ans=`filexp "$ans"`
- X if $test ! -r $ans/common/nntp.h ; then
- X $echo "Can't find $ans/common/nntp.h!"
- X ans='blurfl/dyick'
- X fi
- X done
- X NNTPSRC="$ans"
- X esac
- X
- done
- X: hack for Unisys NET-5000 and Interactive V/386
- case "$isrrn" in
- define)
- X: NET-5000
- X if $test -d /usr/include/NET-5000 ; then
- X $echo "I sense you are on a Unisys 5000 computer...poor soul."
- X rrninclude="-I/usr/include/NET-5000 -DEXCELAN -DUSG"
- X socketlib=-lsocket
- X fi
- X: Interactive Unix
- X if $test -f /usr/lib/libinet.a ; then
- X rrninclude="-DUSG"
- X socketlib=-linet
- X fi
- X ;;
- X*) ;;
- esac
- X
- X
- case "$spool" in
- X'')
- X dflt=/usr/spool/news
- X ;;
- X*) dflt="$spool";;
- esac
- case "$isrrn" in
- define) ans=/tmp;;
- X*) ans='blurfl/dyick';;
- esac
- while $test ! -d $ans; do
- X $echo " "
- X case "$ans" in
- X blurfl*);;
- X *) $echo "Directory $ans not found.";;
- X esac
- X $echo $n "Where is news spooled (~name ok)? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X spool="$ans"
- X case $spool in
- X ~*)
- X ans=`filexp $spool`
- X $echo "(That is $ans on this particular system.)"
- X case $portable in
- X undef) spool=$ans ;;
- X esac
- X ;;
- X *)
- X ans=$spool
- X ;;
- X esac
- done
- X
- X: check on .thread file placement
- if $test "$isrrn " = "define " -a "$serverspool " = " " ; then
- X case "$xthread" in
- X define)
- X ans="/tmp";;
- X *)
- X case "$threaddir" in
- X ''|'.') dflt="/usr/spool/threads";;
- X *) dflt="$threaddir";;
- X esac
- X $echo " "
- X $echo "Pick a directory where you would like the thread files to"
- X $echo $n "be placed: [$dflt] $c"
- X . myread
- X case "$ans" in
- X ''|'.') ans="$dflt";;
- X esac
- X ;;
- X esac
- else
- X case "$threaddir" in
- X ''|'.') dflt=".";;
- X *) dflt="$threaddir";;
- X esac
- X $cat <<'EOM'
- X
- By default we place each group's .thread file in the same spool
- directory as the article files. Alternately, you can place the
- data files in a separate directory if space is tight on the news
- XEOM
- X case "$serverspool" in
- X '') $echo "drive. Where would you like them put? (use '.' to specify the"
- X $echo $n "spool dir): [$dflt] $c"
- X ;;
- X *) $echo "drive. Where would you like them put on the SERVER? (use '.'"
- X $echo $n "to specify the spool dir): [$dflt] $c"
- X ;;
- X esac
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- fi
- threaddir="$ans"
- X
- X: locate active file
- case "$active" in
- X'')
- X dflt=$lib/active
- X ;;
- X*) dflt="$active";;
- esac
- case "$isrrn" in
- define) myactive=.falseactive
- X case "$serverspool" in
- X '') ;;
- X *) $echo " "
- X $echo "What is the name of your SERVER's active file (~name ok)?"
- X $echo $n "[$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X active="$ans"
- X ;;
- X esac
- X : check for active.times
- X case "$activetimes" in
- X ''|none|nntp) dflt="n";;
- X *) dflt="y";;
- X esac
- X cat <<'EOM'
- X
- If your server maintains an accurate "active.times" file (as C news does), trn
- can make use of the much better NEWGROUPS call in NNTP to find new groups. If
- they are running B news, talk them into running acttimes (included) or mthreads
- with the -t option to maintain a fake active.times file. Otherwise, the old
- report-everything-that's-not-in-the-.newsrc method will suffice.
- X
- XEOM
- X $echo $n "Will your server support a reliable NEWGROUPS call? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X case "$ans" in
- X y*) case "$serverspool" in
- X '') activetimes="nntp";;
- X *) case "$activetimes" in
- X '') dflt="${active}.times";;
- X *) dflt="$activetimes";;
- X esac
- X $echo " "
- X $echo "What is the name of your SERVER's active.times file?"
- X $echo $n "[$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X activetimes="$ans"
- X esac
- X ;;
- X *) activetimes='none';;
- X esac
- X ;;
- X*) myactive='blurfl/dyick'
- esac
- while $test ! -f "$myactive"; do
- X $echo " "
- X case "$myactive" in
- X blurfl*);;
- X *) "File $myactive not found.";;
- X esac
- X $echo $n "Where is the active file (~name ok)? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X active="$ans"
- X case $active in
- X ~*)
- X myactive=`filexp $active`
- X $echo "(That is $myactive on this particular system.)"
- X case $portable in
- X undef) active=$myactive ;;
- X esac
- X ;;
- X *)
- X myactive=$active
- X ;;
- X esac
- X if $test -d $myactive ; then
- X myactive=$myactive/active
- X active=$active/active
- X fi
- X
- X : check for active.times
- X case "$activetimes" in
- X ''|none|nntp) dflt="${active}.times";;
- X *) dflt="$activetimes";;
- X esac
- X if $test "$dflt " = "none " -o ! -f $dflt ; then
- X $cat <<'EOM'
- X
- If trn can use a file called active.times it can greatly speed up the
- newgroup-checking code. If you have access to a file maintained by C news,
- use that. Or, if you want to have mthreads maintain it, pick a spot for
- the file and execute mthreads with the -t option. Otherwise, specify "none"
- for the good ol' slow approach.
- X
- XEOM
- X else
- X $cat <<EOM
- X
- X-- Found $dflt --
- If this file is being maintained by C news, mthreads -t, or some other means,
- you'll probably want to use it to greatly speed up the newgroup code. If not
- use "none" to indicate the good ol' slow approach.
- X
- XEOM
- X fi
- X $echo $n "Active.times file to use or 'none'? [$dflt] $c"
- X . myread
- X case "$ans" in
- X '') ans="$dflt";;
- X esac
- X activetimes="$ans"
- done
- X
- X: check for 2.10.2 and above
- X$echo " "
- if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
- X case "$norelay" in
- X undef) dflt="y";;
- X *) dflt="n";;
- X esac
- X case "$isrrn" in
- X define)
- X $echo "Is your NNTP server running an old version of news software," ;;
- X *) $echo "Is your system running an old version of news software," ;;
- X esac
- X $echo $n "predating B News 2.10.3? [${dflt}] $c"
- X . myread
- X case "$ans" in
- X '') ans=$dflt;;
- X esac
- X case "$ans" in
- X y*)
- X norelay='undef'
- X $echo "Looks like you are running at least 2.10.2 news."
- X ;;
- X *) norelay='define' ;;
- X esac
- X mininact=define
- else
- X $echo "It doesn't look like you are running 2.10.2 news yet. Are you planning"
- X $echo $n "to install it in the near future? [y] $c"
- X . myread
- X case $ans in
- X n*) mininact=undef ;;
- X *) mininact=define ;;
- X esac
- X norelay='undef'
- fi
- X
- X
- X: check for void type
- X$echo " "
- X$echo "Checking to see if your C compiler groks the void type..."
- X$cat >try.c <<'EOCP'
- void main();
- XEOCP
- if cc -c try.c >/dev/null 2>&1 ; then
- X novoid='undef'
- X $echo "Yup, it does."
- else
- X novoid='define'
- X $echo "Nope, it doesn't (boo hiss). I will substitute int."
- fi
- X$rm try.*
- X
- X: find out which shell people like to use most
- ans='blurfl/dyick'
- while $test ! -f "$ans" ; do
- X case $ans in
- X blurfl*) ;;
- X *) $echo "$ans does not appear to exist." ;;
- X esac
- X case "$pref" in
- X '')
- X if $test -f /bin/ksh; then
- X dflt='/bin/ksh'
- X else
- X if $test -f /bin/csh; then
- X dflt='/bin/csh'
- X else
- X dflt='/bin/sh'
- X fi
- X fi
- X ;;
- X *) dflt="$pref";;
- X esac
- X $echo " "
- X $echo "Give the full path name of the shell most people like to use on your"
- X $echo $n "system: [$dflt] $c"
- X . myread
- X case $ans in
- X '') ans=$dflt ;;
- X esac
- done
- pref=$ans
- X
- X: locate the preferred pager for this system
- case "$pager" in
- X'')
- X case $pg in
- X /*) dflt=$pg
- X ;;
- X esac
- X case $more in
- X /*) dflt=$more
- X ;;
- X esac
- X case $dflt in
- X '') dflt=/usr/ucb/more
- X ;;
- X esac
- X ;;
- X*) dflt="$pager";;
- esac
- pager='blurfl/dyick'
- while $test ! -f "$pager" ; do
- X case $pager in
- X blurfl*)
- X $echo " "
- X $echo "(If your kernel does terminal paging then you may answer this with '/bin/cat'.)"
- X ;;
- X /*) $echo "$pager does not appear to exist."
- X $echo " "
- X ;;
- X *) $echo "Please give the full path name."
- X $echo " "
- X ;;
- X esac
- X $echo $n "What pager is used on your system? [$dflt] $c"
- X . myread
- X pager="$ans"
- X case $pager in
- X '') pager="$dflt" ;;
- X esac
- done
- X
- X: determine default editor
- case "$defeditor" in
- X'')
- X dflt=`loc vi /usr/ucb $pth`
- X ;;
- X*) dflt="$defeditor"
- X ;;
- esac
- defeditor='blurfl/dyick'
- while $test ! -f "$defeditor" ; do
- X case $defeditor in
- X blurfl*) ;;
- X *) $echo "$defeditor does not appear to exist." ;;
- X esac
- X $echo " "
- X $echo $n "What is the default editor on your system? [$dflt] $c"
- X . myread
- X defeditor="$ans"
- X case $defeditor in
- X '') defeditor=$dflt ;;
- X esac
- done
- X
- X: determine default mailer for Rnmail to use
- X$echo " "
- if $test -f /usr/lib/sendmail; then
- X dflt=/usr/lib/sendmail
- else
- X if usg && $test -f $libexp/recmail; then
- X dflt=$libexp/recmail
- X else
- X dflt=/bin/mail
- X fi
- fi
- X$echo " "
- if $test "$dflt" = "$libexp/recmail"; then
- X $echo "($libexp/recmail is a part of the news package,and can"
- X $echo "be safely used as the default mailer for the rrn package."
- X $echo "You can also use the standard /bin/mail program if you choose.)"
- X $echo " "
- fi
- X$echo $n "What is the default mailer on your system? [$dflt] $c"
- X. ./myread
- mailer="$ans"
- case $mailer in
- X '') mailer=$dflt ;;
- esac
- X$echo "Mail sender is $mailer"
- X
- X: check for internet mailer
- case "$internet" in
- define) dflt=y;;
- undef) dflt=n;;
- X*)
- X case "$isrrn" in
- X define) dflt=y ;;
- X *) dflt=n ;;
- X esac
- X ;;
- esac
- cat <<EOM
- X
- Some newer mailers can deliver mail to addresses of the INTERNET persuasion,
- such as user@host.UUCP. Other older mailers require the complete path to
- the destination to be specified in the address. Does your mailer understand
- XEOM
- X$echo $n "INTERNET addresses? [$dflt] $c"
- X. myread
- case "$ans" in
- X'') ans=$dflt;;
- esac
- case "$ans" in
- y*) internet=define;;
- X*) internet=undef;;
- esac
- X
- X: determine where public executables go
- case "$rnbin" in
- X'')
- X dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
- X ;;
- X*) dflt="$rnbin"
- X ;;
- esac
- rnbin='blurfl/dyick'
- while $test ! -d "$rnbin" ; do
- X case $rnbin in
- X blurfl*) ;;
- X *) $echo "$rnbin does not appear to exist." ;;
- X esac
- X $echo " "
- X $echo $n "Where do you want to put the public executables? [$dflt] $c"
- X . myread
- X rnbin="$ans"
- X rnbin=`filexp $rnbin`
- X case $rnbin in
- X '') rnbin=$dflt ;;
- X esac
- done
- X
- X: determine where private executables go
- case "$rnlib" in
- X'')
- X case "$isrrn" in
- X define) dflt=/usr/local/lib/trn ;;
- X *) dflt=$lib/trn ;;
- X esac
- X ;;
- X*) dflt="$rnlib"
- X ;;
- esac
- X$echo " "
- X$echo "Trn has a number of auxiliary programs that need not be visible to the"
- X$echo "whole world. Where do you want to put these private executables?"
- X$echo $n "[$dflt] $c"
- X. myread
- rnlib="$ans"
- case $rnlib in
- X '') rnlib=$dflt ;;
- esac
- case $portable in
- undef)
- X rnlib=`filexp $rnlib`
- X ;;
- esac
- X: must not allow self reference
- case $rnlib in
- X /*)
- X filexp=$rnlib/filexp
- X ;;
- X *)
- X filexp=`pwd`/filexp
- X ;;
- esac
- X
- X: find where to put private files for mthreads
- case "$mtlib" in
- X'') dflt="$rnlib" ;;
- X*) dflt="$mtlib" ;;
- esac
- cat <<'EOM'
- X
- Mthreads needs to create some private files (like active2, and maybe active1
- and mt.log, depending on your setup). These can go in the same directory as
- the private executables, as long as it is writable by whoever runs mthreads.
- Otherwise, a good place to put them is in your thread file directory. Where
- XEOM
- X$echo $n "should these files be kept? [$dflt] $c"
- X. myread
- mtlib="$ans"
- case "$mtlib" in
- X'') mtlib=$dflt ;;
- esac
- X
- X: get the local distribution prefixes
- if $test -f $libexp/sys ; then
- X $sed <$libexp/sys -n -e "s/^$sitename://p" | \
- X $sed -e "s/:.*//" -e "s/,/ /g" | tr ' ' '\012' | \
- X $sed -e "/^to./d" -e "/^net$/d" -e "/^fa$/d" -e "/^mod$/d" > .distlist
- fi
- X
- X$cat <<'EOH'
- X
- Distribution groups are the things you use on the Distribution line to limit
- where an article will go to. You are likely to be a member of several
- distribution groups, such as organization, city, state, province, country,
- continent, etc. For example, Los Angeles has the distribution prefix "la",
- New Jersey has the prefix "nj", and Europe has the prefix "eunet".
- X
- The categories you will be asked are:
- X
- local organization (Could be just one machine or a cluster or an office)
- organization att, dec, kgb, ...
- city la, ny, mosc, ...
- state/province ca, nj, bc, ...
- country usa, can, rok, whatever
- continent na (North America, not "Not Applicable"), asia, etc.
- X
- X(If you don't have a distribution prefix in any of these categories then
- just hit return.)
- X
- XEOH
- if $test -f .distlist; then
- X distlist=`tr '\012' ' ' <.distlist`
- X if $test "$distlist" ; then
- X $echo "(These are the distributions in your sys file: $distlist)"
- X $echo " "
- X fi
- fi
- case "$locpref" in
- X'') dflt="";;
- X*) dflt="[$locpref] ";;
- esac
- X$echo $n "What is the distribution prefix for your local organization? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) locpref="$ans";;
- esac
- case $locpref in
- X '') locpref=none ;;
- esac
- case "$orgpref" in
- X'') dflt="";;
- X*) dflt="[$orgpref] ";;
- esac
- X$echo $n "What is the distribution prefix for your organization? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) orgpref="$ans";;
- esac
- case $orgpref in
- X '') orgpref=none ;;
- esac
- case "$citypref" in
- X'') dflt="";;
- X*) dflt="[$citypref] ";;
- esac
- X$echo $n "What is the distribution prefix for your city? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) citypref="$ans";;
- esac
- case $citypref in
- X '') citypref=none ;;
- esac
- case "$statepref" in
- X'') dflt="";;
- X*) dflt="[$statepref] ";;
- esac
- X$echo $n "What is the distribution prefix for your state/province? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) statepref="$ans";;
- esac
- case $statepref in
- X '') statepref=none ;;
- esac
- case "$cntrypref" in
- X'') dflt="";;
- X*) dflt="[$cntrypref] ";;
- esac
- X$echo $n "What is the distribution prefix for your country? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) cntrypref="$ans";;
- esac
- case $cntrypref in
- X '') cntrypref=none ;;
- esac
- case "$contpref" in
- X'') dflt="";;
- X*) dflt="[$contpref] ";;
- esac
- X$echo $n "What is the distribution prefix for your continent? $dflt$c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) contpref="$ans";;
- esac
- case $contpref in
- X '') contpref=none ;;
- esac
- X
- X$echo " "
- X$echo "If you have any other distribution groups you will need to edit Pnews"
- X$echo "and newsetup to add them."
- X$echo " "
- X
- X: determine root id
- rootid=`$sed </etc/passwd -e "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
- case $rootid in
- X '') rootid=0 ;;
- X *) $echo "Root uid = $rootid" ;;
- esac
- X
- X: weed out incompatibilities
- case $douname in
- X define) whoami=undef ;;
- esac
- X
- X: preserve RCS keywords in files with variable substitution, grrr
- Log='$Log'
- Id='$Id'
- X
- X: Warnings
- if v7; then
- X cat <<'EOM'
- X
- NOTE: the V7 compiler may ignore some #undefs that trn uses. If so, you will
- get messages about redefining EXT. Some V7 compilers also have difficulties
- with #defines near buffer boundaries, so beware. You may have to play with
- the spacing in common.h.
- XEOM
- fi
- X
- if pdp11; then
- X cat <<'EOM'
- X
- NOTE: the PDP-11 does not have enough data space to do subject caching
- reliably. That feature will be disabled automatically. Subject searching
- will tend to be slow.
- XEOM
- fi
- case "$isrrn" in
- X define) ;;
- X *) socketlib=""
- X rrninclude=""
- X ;;
- esac
- X
- X$echo " "
- X$echo "End of configuration questions."
- X$echo " "
- X
- X: create config.sh file
- X$echo " "
- X$echo "Creating config.sh..."
- X$spitshell <<EOT >config.sh
- X$startsh
- X# config.sh
- X# This file was produced by running the Configure script.
- X
- n='$n'
- c='$c'
- libc='$libc'
- sharedclib='$sharedclib'
- eunicefix='$eunicefix'
- eunice='$eunice'
- cpp='$cpp'
- shsharp='$shsharp'
- startsh='$startsh'
- spitshell='$spitshell'
- test='$test'
- expr='$expr'
- sed='$sed'
- echo='$echo'
- cat='$cat'
- rm='$rm'
- mv='$mv'
- cp='$cp'
- tail='$tail'
- tr='$tr'
- mkdir='$mkdir'
- sort='$sort'
- uniq='$uniq'
- inews='$inews'
- grep='$grep'
- egrep='$egrep'
- nidump='$nidump'
- ypmatch='$ypmatch'
- contains='$contains'
- lib='$lib'
- libexp='$libexp'
- nametype='$nametype'
- cc='$cc'
- cflags='$cflags'
- iandd='$iandd'
- rrninclude='$rrninclude'
- termlib='$termlib'
- jobslib='$jobslib'
- socketlib='$socketlib'
- getcwd='$getcwd'
- getwd='$getwd'
- setbuffer='$setbuffer'
- setvbuf='$setvbuf'
- dirtype='$dirtype'
- dirinc='$dirinc'
- ndirlib='$ndirlib'
- libndir='$libndir'
- usendir='$usendir'
- ndirc='$ndirc'
- ndiro='$ndiro'
- posix='$posix'
- pager='$pager'
- mailer='$mailer'
- internet='$internet'
- rnbin='$rnbin'
- filexp='$filexp'
- distlist='$distlist'
- Log='$Log'
- Id='$Id'
- sitename='$sitename'
- hostfile='$hostfile'
- domain='$domain'
- orgname="$orgname"
- isadmin='$isadmin'
- newsadmin='$newsadmin'
- rnlib='$rnlib'
- mtlib='$mtlib'
- mansrc='$mansrc'
- manext='$manext'
- maildir='$maildir'
- spool='$spool'
- serverspool='$serverspool'
- active='$active'
- myactive='$myactive'
- activetimes='$activetimes'
- mininact='$mininact'
- pref='$pref'
- defeditor='$defeditor'
- rootid='$rootid'
- mboxchar='$mboxchar'
- locpref='$locpref'
- orgpref='$orgpref'
- citypref='$citypref'
- statepref='$statepref'
- cntrypref='$cntrypref'
- contpref='$contpref'
- strchr='$strchr'
- memcpy='$memcpy'
- rename='$rename'
- ftruncate='$ftruncate'
- usleep='$usleep'
- uselect='$uselect'
- strftime='$strftime'
- xnxlib='$xnxlib'
- chsize='$chsize'
- tzset='$tzset'
- threaddef='$threaddef'
- selectdef='$selectdef'
- threaddir='$threaddir'
- syslog='$syslog'
- novoid='$novoid'
- novfork='$novfork'
- sunos4='$sunos4'
- portable='$portable'
- passnam='$passnam'
- berknam='$berknam'
- usgnam='$usgnam'
- whoami='$whoami'
- termio='$termio'
- termios='$termios'
- fcntl='$fcntl'
- ioctl='$ioctl'
- ptem='$ptem'
- normsig='$normsig'
- sigblock='$sigblock'
- sigret='$sigret'
- sighold='$sighold'
- getuidgid='$getuidgid'
- havetlib='$havetlib'
- getpwent='$getpwent'
- gethostname='$gethostname'
- douname='$douname'
- phostname='$phostname'
- hostcmd='$hostcmd'
- norelay='$norelay'
- rdchk='$rdchk'
- isrrn='$isrrn'
- xthread='$xthread'
- serverfile='$serverfile'
- ignoreorg='$ignoreorg'
- NNTPSRC='$NNTPSRC'
- CONFIG=true
- XEOT
- CONFIG=true
- X$rm -f libc.list .distlist kit*isdone
- X
- X$echo "If you didn't make any mistakes, then just type a carriage return here."
- X$echo $n "If you need to edit config.sh, do it as a shell escape here: $c"
- X. myread
- case "$ans" in
- X'') ;;
- X*) : in case they cannot read
- X eval $ans;;
- esac
- X. ./config.sh
- X
- X$echo " "
- X$echo "Doing variable substitutions on various files..."
- X$echo " "
- set `$grep <MANIFEST '\.SH' | awk '{print $1}'`
- for file in $*; do
- X . $file
- done
- X
- X$echo " "
- X$echo 'Now you need to generate make dependencies by running "makedepend".'
- X$echo 'You might prefer to run it in background: "makedepend > makedepend.out &"'
- X$echo $n "Would you like me to run it for you (it takes quite a while)? [n] $c"
- X. myread
- case "$ans" in
- y*) ./makedepend;;
- esac
- X$rm -f myread
- X: end of Configure
- END_OF_FILE
- if test 69963 -ne `wc -c <'Configure'`; then
- echo shar: \"'Configure'\" unpacked with wrong size!
- fi
- chmod +x 'Configure'
- # end of 'Configure'
- fi
- echo shar: End of archive 12 \(of 13\).
- cp /dev/null ark12isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 13 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-